{include file="layout_basic.tpl"}
<script>
	var dma = '{$dma}';
	var hms = '{$hms}';
</script>
<form name="form" action="" method="post">
	<fieldset>
		<legend>{$ui.newlancamento}</legend>
			<dl>
				<dt> <label>{$ui.date}</label> </dt>
				<dd> <input type="text" name="data" value="{$edit.data_lan}"> 
				<input type="button" value="< {$ui.today}" onclick="document.form.data.value=dma">
				</dd>
			</dl>
			
			<dl>
				<dt> <label>{$ui.time}</label> </dt>
				<dd> <input type="text" name="hora" value="{$edit.hora_lan}"> 
				<input type="button" value="< {$ui.now}" onclick="document.form.hora.value=hms">
				</dd>
			</dl>

			<dl>
				<dt> <label>{$ui.nomeconta}</label> </dt>
				<dd>
					<select name="conta">
						{foreach from=$con item=row}
							<option value="{$row.cod_conta}"  {if $row.cod_conta == $edit.cod_conta} selected="selected"{/if}>{$row.nome_conta}</option>
						{/foreach}
					</select>
				</dd>
			</dl>

			<dl>
				<dt> <label>{$ui.catname}</label> </dt>
				<dd>
					<select name="categoria" onchange="document.form.defval.value=this.options[this.selectedIndex].id">
						<option value=""> ----------------- </option>
						{foreach from=$cat item=row}
							<option id="{$row.valor_padrao}" value="{$row.cod_categoria}" {if $row.cod_categoria == $edit.cod_categoria} selected="selected"{/if} >{$row.nome_categoria}</option>
						{/foreach}
					</select>
				</dd>
			</dl>
			
			<dl>
				<dt> <label>{$ui.thevalue}</label> </dt>
				<dd> <input type="text" name="valor" value="{$edit.valor_lan}"> <input type="button" name="defval" value="00.00" onclick="document.form.valor.value = this.value"/> </dd>
			</dl>	
					
			<dl>
				<dt> <label>{$ui.commited}</label> </dt>
				<dd> <input type="checkbox" value="1" name="efetivado" {if $edit.efetivado or $edit.efetivado==''} checked="checked" {/if} /> </dd>
			</dl>	
					
			<dl>
				<dt> <label>{$ui.description}</label> </dt>
				<dd> <textarea rows="2" cols="60" name="descricao">{$edit.descricao}</textarea></dd>
			</dl>	
			
			<dl>
				<dt></dt>
				<dd> <input type="submit" value="{$ui.saveaction}"/> </dd>
			</dl>

	</fieldset>
</form>
{include file="layout_basic_tail.tpl"}